mike = {'rank': 'Assistant Prof', 'years': 3, 'tenured': 'no'}


def giveTenured(obj):
    if (obj['rank'] == 'Assistant Prof' and obj['years'] >= 7) or (obj['rank'] == 'Professor' and obj['years'] >= 2):
        return 'yes'
    else:
        return 'no'


print(giveTenured(mike))
